package concurrent.atomic;

import java.util.concurrent.atomic.AtomicReference;

public class AtomicReferenceTest {

	public static void main(String[] args) {
		
		AtomicReference<String> atomicReference = new AtomicReference<String>();
		atomicReference.set("涂有");
		System.out.println(atomicReference.get());
		
		atomicReference.compareAndSet("涂有", "杨瑞");
		System.out.println(atomicReference.get());
	}
}
